package com.huqing.icu.base;

import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.functions.T;

import java.util.Collections;
import java.util.List;

/**
 * 分页通用结结构
 */
public class PagingDto<R> {

    private List<T> list;

    private int totalPage;

    private int totalSize;

    public <T> PagingDto(List list, int totalPage, int totalSize) {
        if (CollectionUtils.isEmpty(list)) {
            this.list = Collections.emptyList();
        } else {
            this.list = list;
        }
        this.totalPage = totalPage;
        this.totalSize = totalSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        if (CollectionUtils.isEmpty(list)) {
            this.list = Collections.emptyList();
        } else {
            this.list = list;
        }
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(int totalSize) {
        this.totalSize = totalSize;
    }
}
